package com.example.demoamqp.receiver;

import com.example.demoamqp.conatants.Constants;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * Topic模式消费者
 * 消息消费者
 */
@Slf4j
@Component
public class MqTopicsReceiver {

    @RabbitListener(queues = Constants.MQ_TOPIC_QUEUE_A)
    public void recevicel(String message) {
        log.info("Topic A 消费：{}", message);
    }

    @RabbitListener(queues = Constants.MQ_TOPIC_QUEUE_B)
    public void recevicel1(String message) {
        log.info("Topic B 消费：{}", message);
    }
}